package com.lzy.cloud.order.dos;

import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class OrderActions {

	/** 订单编号 */
	private String orderId;
	/** 小状态 */
	private Integer minStatus;
	/** 车状态 */
	private Integer carStatus;
	private String desStatus;
	/** 大状态 */
	private Integer maxStatus;
	/** 用户行为 */
	private String customerMethod;
	/** 商家行为 */
	private String shopMethod;
	/** 运营行为 */
	private String adminMethod;
	/** 售后情况 */
	private Integer refund;
	/** 发货时间 */
	private Date sendTime;
	/** 实际支付金额 */
	private BigDecimal moneyPaid;
	private Date payTime;
	/** 付款方式 */
	private Integer payWay;
	private Date completeTime;
	private Date stopPayTime;

	public static OrderActions readFromDO(OrderActionDO oaDO) {
		OrderActions result = new OrderActions();
		if (oaDO == null)
			return null;
		result.setOrderId(oaDO.getOrderId());
		result.setMaxStatus(oaDO.getMaxStatus());
		if (oaDO.getOsde() != null) {
			result.setDesStatus(oaDO.getOsde().getDes());
			result.setMinStatus(oaDO.getOsde().getStatus());
		}
		result.setCarStatus(oaDO.getCarStatus());
		result.setCustomerMethod(oaDO.getCustomerMethod());
		result.setShopMethod(oaDO.getShopMethod());
		result.setAdminMethod(oaDO.getAdminMethod());
		result.setRefund(oaDO.getRefund());
		result.setSendTime(oaDO.getSendTime());
		result.setMoneyPaid(oaDO.getMoneyPaid());
		result.setPayTime(oaDO.getPayTime());
		result.setPayWay(oaDO.getPayWay());
		result.setCompleteTime(oaDO.getCompleteTime());
		result.setStopPayTime(oaDO.getStopPayTime());
		return result;
	}

}
